﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace StudyCollections
{
    class MyEqualityCaseInsensitive: IEqualityComparer
    {
        
        CaseInsensitiveComparer _comparer = new CaseInsensitiveComparer(CultureInfo.CurrentCulture);
        
        public bool Equals(object x, object y)
        {
            if (_comparer.Compare(x, y) == 0)
                return true; // Sono identici
            else
                return false; // Sono diversi
        }

        public int GetHashCode(object obj)
        {
            return obj.ToString().ToUpper().GetHashCode();
        }
    }
}
